<?php
switch($action){
	/************************************** cache BEGIN ************************************************/
	case "cache":
echo <<<EOT
	<div id="smalltab_container"></div>
	<div class="smalltab_line"></div>
	<div class="div_clear" style="height:10px;"></div>
	<div id="t1">
		<div class="tips_1"><b>重新生成缓存</b><br />
		* 正常情况下无需使用该功能。如果您有手动修改过数据库、缓存文件，则可以使用该功能重新生成缓存。
		</div>
		<form id="cacheform" onsubmit="return false;">
		<div class="div_clear" style="height:10px;"></div>
		<table class="table_1">
			<tr><td class="td_0">重新生成缓存类别:<span class='required'>(*)</span></td><td class=""></td></tr>
			<tr><td class="td_1"><select id="cachetype" name="cachetype" multiple="true" style="width:200px;padding:2px;" size="10"><option value='all' selected="true">全部</option><option value='ads'>广告缓存</option><option value='announces'>公告缓存</option><option value='credits'>积分缓存</option><option value='forums'>版块缓存</option><option value='groups'>用户组缓存</option><option value='links'>友情链接缓存</option><option value='settings'>系统设置缓存</option><option value='stamps'>鉴定选项缓存</option></select></td><td class="td_2">请选择要重新生成缓存的类别，可以按住 CTRL 多选。</td></tr>
			<tr><td class="td_3"><input class="button_css" type="button" value="  提  交  " onclick="ajax_rebuildcache()" /></td><td class=""></td></tr>
		</table>
		</form>
	</div>
	<div id="t2"></div>
	<div id="t3"></div>
	<div class="div_clear" style="height:30px;"></div>
	<script>
	var smallNowTab;
	var pt = new Tabs();
	pt.classpre="smalltab_";
	pt.container = "smalltab_container";
	pt.createTab("t1","重新生成论坛缓存","",true,"n");
	pt.init = function(){
		smallNowTab = pt.nowTab;
	};
	pt.onclick = function(){
		smallNowTab = pt.nowTab;
	};		
	pt.initTab();
	pt.clickNowTab();
	
	function ajax_rebuildcache(){
		popwin.loading();
		ajaxPost("cacheform","main_ajax.php?action=rebuildcache", ajax_rebuildcache_callback);
	}
	function ajax_rebuildcache_callback(data){
		var btns=[{value:" 确 定 ",onclick:"popwin.close();",focus:true}];
		popwin.loaded();
		if(data=="y"){
			popwin.showDialog(1,"操作成功","重新生成论坛缓存成功。",btns,280,130);
		}else{
			popwin.showDialog(0,"操作失败","操作失败:<br />"+data,btns,280,130);
		}
	}
	
	</script>
EOT;
	break;
	/************************************** cache END ************************************************/

	/************************************** stat BEGIN ************************************************/
	case "stat":
	$cache1=$db->row_select_one("cache1","","*");
	$cache1['mostonlinetime']=getDateStr($cache1['mostonlinetime'],false,false);
echo <<<EOT
	<style>
		.td_5_1{width:280px;color:#666666;}
	</style>
	<div id="smalltab_container"></div>
	<div class="smalltab_line"></div>
	<div class="div_clear" style="height:10px;"></div>
	<div id="t1">
		<form id="statform" onsubmit="return false;">
		<div class="div_clear" style="height:10px;"></div>
		<table class="table_1">
			<tr><td class="td_0">主题数:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="text" size="10" value="{$cache1['topicsnum']}" name="cache1[topicsnum]" id="topicsnum" class="text_css" /></td><td class="td_2"></td></tr>
			<tr><td class="td_0">帖子数:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="text" size="10" value="{$cache1['postsnum']}" name="cache1[postsnum]" id="postsnum" class="text_css" /></td><td class="td_2"></td></tr>
			<tr><td class="td_0">会员数:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="text" size="10" value="{$cache1['usersnum']}" name="cache1[usersnum]" id="usersnum" class="text_css" /></td><td class="td_2"></td></tr>
			<tr><td class="td_0">最高日帖子数:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="text" size="30" value="{$cache1['mostnum']}" name="cache1[mostnum]" id="mostnum" class="text_css" /></td><td class="td_2"></td></tr>
			<tr><td class="td_0">在线用户最多人数:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="text" size="30" value="{$cache1['mostonlinenum']}" name="cache1[mostonlinenum]" id="mostonlinenum" class="text_css" /></td><td class="td_2"></td></tr>
			<tr><td class="td_0">在线用户最多人数发生时间:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="text" size="30" value="{$cache1['mostonlinetime']}" name="cache1[mostonlinetime]" id="mostonlinetime" class="text_css" /></td><td class="td_2"></td></tr>
			<tr class="tr_5"><td class="td_0"><a class="td_5_1a" href="javascript:ajax_getstat()">重新获取统计数据</a></td><td class="td_2"></td></tr>

			<tr><td class="td_3"><input class="button_css" type="button" value="  提  交  " onclick="ajax_savestat()" /></td><td class=""></td></tr>
		</table>
		</form>
	</div>
	<div id="t2">
		<div class="tips_1"><b>版块统计数据</b><br />
		* 如果您对论坛进行过批量删除帖子等操作，或者版块的帖子数量统计错误，可以使用该功能重新统计。
		</div>	
		<form id="stat2form" onsubmit="return false;">
		<div class="div_clear" style="height:10px;"></div>
		<table class="table_1">
			<tr class="tr_5"><td class="td_5_1" style="font-weight:bold;color:#333333;">版块名称</td><td class="td_5_2" style="font-weight:bold;color:#333333;">主题数</td><td class="td_5_3" style="font-weight:bold;color:#333333;">帖数</td><td>&nbsp;</td></tr>
EOT;

				$tabindex=1000;
				$rows1=$db->row_select("forums","pid=0",0,"*","ordernum,id");
				for($i=0;$i<count($rows1);$i++){
					$row1=$rows1[$i];
					$tabindex++;
					echo("<tr class=\"tr_5\"><td class=\"td_5_1\"><span class=\"forum_click1\"></span><span class=\"forum_name\">{$row1[forumname]}</span><span style='color:#999999;'>FID:{$row1['id']}</span></td><td class=\"td_5_2\">&nbsp;</td><td class=\"td_5_3\">&nbsp;</td><td>&nbsp;</td></tr>");
					$rows2=$db->row_select("forums","pid={$row1['id']}",0,"*","ordernum,id");
					for($j=0;$j<count($rows2);$j++){
						$row2=$rows2[$j];
						$tabindex++;
						echo("<tr class=\"tr_5\"><td class=\"td_5_1\"><span class=\"forum_1\"></span><span class=\"forum_name\">{$row2[forumname]}</span><span style='color:#999999;'>FID:{$row2['id']}</span></td><td class=\"td_5_2\"><input type=\"text\" size=\"8\" value=\"{$row2[topicsnum]}\" name=\"topicsnum[{$row2['id']}]\" id=\"topicsnum[{$row2['id']}]\" class=\"text_css\" /></td><td class=\"td_5_3\"><input type=\"text\" size=\"8\" value=\"{$row2[postsnum]}\" name=\"postsnum[{$row2['id']}]\" id=\"postsnum[{$row2['id']}]\" class=\"text_css\" /></td><td>&nbsp;</td></tr>");
						$rows3=$db->row_select("forums","pid={$row2['id']}",0,"*","ordernum,id");
						for($k=0;$k<count($rows3);$k++){
							$row3=$rows3[$k];
							$tabindex++;
							echo("<tr class=\"tr_5\"><td class=\"td_5_1\"><span class=\"forum_0\"></span><span class=\"forum_1\"></span><span class=\"forum_name\">{$row3[forumname]}</span><span style='color:#999999;'>FID:{$row3['id']}</span></td><td class=\"td_5_2\"><input type=\"text\" size=\"8\" value=\"{$row3[topicsnum]}\" name=\"topicsnum[{$row3['id']}]\" id=\"topicsnum[{$row3['id']}]\" class=\"text_css\" /></td><td class=\"td_5_3\"><input type=\"text\" size=\"8\" value=\"{$row3[postsnum]}\" name=\"postsnum[{$row3['id']}]\" id=\"postsnum[{$row3['id']}]\" class=\"text_css\" /></td><td>&nbsp;</td></tr>");
						}
					}
				}
				echo("<tr class=\"tr_5\"><td><a class=\"td_5_1a\" href=\"javascript:ajax_getforumstat()\">重新获取统计数据</a></td><td class=\"td_5_2\"></td><td class=\"td_5_3\"></td><td>&nbsp;</td></tr>");
echo <<<EOT
			<tr><td class="td_3"><input class="button_css" type="button" value="  提  交  " onclick="ajax_saveforumstat()" /></td></tr>
		</table>
		</form>
	</div>	<div id="t3"></div>
	<div class="div_clear" style="height:30px;"></div>
	<script>
	var smallNowTab;
	var pt = new Tabs();
	pt.classpre="smalltab_";
	pt.container = "smalltab_container";
	pt.createTab("t1","论坛统计数据","",true,"n");
	pt.createTab("t2","版块统计数据","",false,"n");
	pt.init = function(){
		smallNowTab = pt.nowTab;
	};
	pt.onclick = function(){
		smallNowTab = pt.nowTab;
	};		
	pt.initTab();
	pt.clickNowTab();

	
	function ajax_getstat(){
		popwin.loading();
		ajaxGet("main_ajax.php?action=getstat", ajax_getstat_callback);
	}
	function ajax_getstat_callback(data){
		popwin.loaded();
		var rs=data.split(",");
		E("topicsnum").value=rs[0];
		E("postsnum").value=rs[1];
		E("usersnum").value=rs[2];
	}
	
	function ajax_savestat(){
		popwin.loading();
		ajaxPost("statform","main_ajax.php?action=savestat",ajax_savestat_callback);
	}
	function ajax_savestat_callback(data){
		var btns=[{value:" 确 定 ",onclick:"popwin.close();",focus:true}];
		popwin.loaded();
		if(data=="y"){
			popwin.showDialog(1,"修改成功","论坛统计数据修改成功",btns,280,130);
		}else{
			popwin.showDialog(0,"操作失败","操作失败:<br />"+data,btns,280,130);
		}
	}
	
	
	function ajax_getforumstat(){
		popwin.loading();
		var formobj = E("stat2form");
		for (var i = 0; i < formobj.elements.length; i++) {
			if(formobj.elements[i].className=='text_css'){
				formobj.elements[i].value="0";
			}
		}
		ajaxGet("main_ajax.php?action=getforumstat", ajax_getforumstat_callback);
	}
	function ajax_getforumstat_callback(data){
		var btns=[{value:" 确 定 ",onclick:"popwin.close();",focus:true}];
		popwin.loaded();
		try{
			var strs=data.split("|");
			var ts=strs[0].split(",");
			var tss;
			for(var tsi=0; tsi<ts.length; tsi++){
				tss=ts[tsi].split(":");
				if(E("topicsnum["+tss[0]+"]")){
					E("topicsnum["+tss[0]+"]").value=tss[1];
				}
			}

			var ps=strs[1].split(",");
			var pss;
			for(var psi=0; psi<ps.length; psi++){
				pss=ps[psi].split(":");
				if(E("postsnum["+pss[0]+"]")){
					E("postsnum["+pss[0]+"]").value=pss[1];
				}
			}
		}catch(err){
			popwin.showDialog(0,"操作失败","获取统计数据失败。",btns,280,130);
		}
	}

	function ajax_saveforumstat(){
		popwin.loading();
		ajaxPost("stat2form","main_ajax.php?action=saveforumstat",ajax_saveforumstat_callback);
	}
	function ajax_saveforumstat_callback(data){
		var btns=[{value:" 确 定 ",onclick:"popwin.close();",focus:true}];
		popwin.loaded();
		if(data=="y"){
			popwin.showDialog(1,"修改成功","版块统计数据修改成功",btns,280,130);
		}else{
			popwin.showDialog(0,"操作失败","操作失败:<br />"+data,btns,280,130);
		}
	}
	


	</script>
EOT;
	break;
	/************************************** stat END ************************************************/
	

	/************************************** seo END ************************************************/
	case "seo":
	$row=getSettings();
	$url=$cache_settings['url'];
	$url=(substr($url, -1)=="/"?substr($url,0,strlen($url)-1):$url);
		
echo <<<EOT
	<style>
		.td_1{width:400px;}
	</style>
	<div id="smalltab_container"></div>
	<div class="smalltab_line"></div>
	<div class="div_clear" style="height:10px;"></div>
	<div id="t1">
		<form id="seoform1" onsubmit="return false;">
		<div class="tips_1"><b>SEO设置提示</b><br />
		* 启用SEO可以增加搜索引擎对论坛的收录。<br />
	    * 启用Google的SiteMap之后，请到Google的站长管理工具提交Sitemap的地址。</div>
		<div class="div_clear" style="height:10px;"></div>
		<table class="table_1">
			<tr><td class="td_0">Meta Keywords:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="text" size="40" value="{$row['metakeywords']}" name="settings[metakeywords]" id="metakeywords" class="text_css" /></td><td class="td_2">Keywords 项出现在页面头部的 Meta 标签中，用于记录本页面的关键字，多个关键字间请用半角逗号 "," 隔开</td></tr>
			<tr><td class="td_0">Meta Description:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="text" size="40" value="{$row['metadescription']}" name="settings[metadescription]" id="metadescription" class="text_css" /></td><td class="td_2">Description 出现在页面头部的 Meta 标签中，用于记录本页面的概要与描述</td></tr>
			<tr><td class="td_0">其他头部信息:</td><td class=""></td></tr>
			<tr><td class="td_1"><textarea style="height:70px;width:260px;" name="settings[headcontent]" id="headcontent">{$row['headcontent']}</textarea></td><td class="td_2">如需在 <head></head> 中添加其他的 HTML 代码，可以使用本设置，否则请留空</td></tr>
			<tr><td class="td_0">Baidu SiteMap地址:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="text" size="40" readonly="true" value="{$url}/sitemap/index.php" onmouseover="this.select()" class="text_css" /></td><td class="td_2">不可编辑。请到<a href="http://sitemap.baidu.com/" target="_blank">百度的站长平台</a>提交该地址</td></tr>
			<tr><td class="td_0">Google SiteMap地址:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="text" size="40" readonly="true" value="{$url}/sitemap/index.php" onmouseover="this.select()" class="text_css" /></td><td class="td_2">不可编辑。请到<a href="http://www.google.com/webmasters/sitemaps" target="_blank">Google的网站管理员工具</a>提交该地址</td></tr>
			<tr><td class="td_3"><input class="button_css" type="button" value="  提  交  " onclick="ajax_saveseoinfo()" /></td><td class=""></td></tr>
		</table>
		</form>
	</div>
	<div id="t2">
		<form id="urlform2" onsubmit="return false;">
		<div class="tips_1"><b>伪静态提示</b><br />
		* 启用伪静态可以增加搜索引擎对论坛的收录。
		</div>
		<div class="div_clear" style="height:10px;"></div>
		<table class="table_1">
			<tr><td class="td_0">开启伪静态:</td><td class=""></td></tr>
			<tr><td class="td_1" style="line-height:200%;">
				<input type="radio" value="0" name="settings[urlrewrite]" class="radio_css" /> 关闭<br />
				<input type="radio" value="1" name="settings[urlrewrite]" class="radio_css" /> 程序实现 (例如:http://domainname/?forum-1.html)<br />
				<input type="radio" value="2" name="settings[urlrewrite]" class="radio_css" /> 服务器配置 (例如:http://domainname/forum-1.html)
				</td><td class="td_2">程序实现：一般虚拟主机则可支持<br />服务器配置：需要服务器支持与配置Url Rewrite规则 </td></tr>
			<tr><td class="td_3"><input class="button_css" type="button" value="  提  交  " onclick="ajax_saveurlrewriteinfo()" /></td><td class=""></td></tr>
		</table>
		</form>	
	</div>
	<div id="t3"></div>
	<div class="div_clear" style="height:30px;"></div>
	<script>
	var smallNowTab;
	var pt = new Tabs();
	pt.classpre="smalltab_";
	pt.container = "smalltab_container";
	pt.createTab("t1","SEO设置","",true,"n");
	pt.createTab("t2","伪静态","",false,"n");
	pt.init = function(){
		smallNowTab = pt.nowTab;
	};
	pt.onclick = function(){
		smallNowTab = pt.nowTab;
	};		
	pt.initTab();
	pt.clickNowTab();
	
	var seobaidu="{$row['seobaidu']}";
	var seogoogle="{$row['seogoogle']}";
	var urlrewrite="{$row['urlrewrite']}";
	setRadioCheck("settings[seobaidu]",seobaidu);
	setRadioCheck("settings[seogoogle]",seogoogle);
	setRadioCheck("settings[urlrewrite]",urlrewrite);
	
	function ajax_saveseoinfo(){
		popwin.loading();
		ajaxPost("seoform1","main_ajax.php?action=saveseoinfo",ajax_saveseoinfo_callback);
	}
	function ajax_saveseoinfo_callback(data){
		var btns=[{value:" 确 定 ",onclick:"popwin.close();",focus:true}];
		popwin.loaded();
		if(data=="y"){
			popwin.showDialog(1,"修改成功","论坛SEO设置修改成功",btns,280,130);
		}else{
			popwin.showDialog(0,"操作失败","操作失败:<br />"+data,btns,280,130);
		}
	}
	
	function ajax_saveurlrewriteinfo(){
		popwin.loading();
		ajaxPost("urlform2","main_ajax.php?action=saveurlrewriteinfo",ajax_saveurlrewriteinfo_callback);
	}
	function ajax_saveurlrewriteinfo_callback(data){
		var btns=[{value:" 确 定 ",onclick:"popwin.close();",focus:true}];
		popwin.loaded();
		if(data=="y"){
			popwin.showDialog(1,"修改成功","论坛伪静态设置修改成功",btns,280,130);
		}else{
			popwin.showDialog(0,"操作失败","操作失败:<br />"+data,btns,280,130);
		}
	}
	
	</script>
EOT;
	break;
	/************************************** seo END ************************************************/



	/************************************** securitycode BEGIN ************************************************/
	case "securitycode":	//验证码设置
	$row=getSettings();
echo <<<EOT
	<div id="smalltab_container"></div>
	<div class="smalltab_line"></div>
	<div class="div_clear" style="height:10px;"></div>
	<div id="t1">
		<form id="verifyform" onsubmit="return false;">
		<div class="tips_1"><b>验证码设置</b><br />
		* 验证码可以避免恶意注册及恶意灌水，请选择需要打开验证码的操作。<br />* 注意: 启用验证码会使得部分操作变得繁琐，建议仅在必需时打开。</div>
		<div class="div_clear" style="height:10px;"></div>
		<table class="table_1">
			<tr><td class="td_0">启用注册验证码:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="radio" value="1" name="settings[signupsecuritycode]" class="radio_css" /> 是 &nbsp; &nbsp;<input type="radio" value="0" name="settings[signupsecuritycode]" class="radio_css" /> 否</td><td class="td_2">注册时需要填写验证码</td></tr>
			<tr><td class="td_0">启用登录验证码:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="radio" value="1" name="settings[loginsecuritycode]" class="radio_css" /> 是 &nbsp; &nbsp;<input type="radio" value="0" name="settings[loginsecuritycode]" class="radio_css" /> 否</td><td class="td_2">登录时需要填写验证码</td></tr>
			<tr><td class="td_0">启用发帖验证码:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="radio" value="1" name="settings[postsecuritycode]" class="radio_css" /> 是 &nbsp; &nbsp;<input type="radio" value="0" name="settings[postsecuritycode]" class="radio_css" /> 否</td><td class="td_2">发帖时需要填写验证码</td></tr>
	
			<tr><td class="td_3"><input class="button_css" type="button" value="  提  交  " onclick="ajax_saveverifyinfo()" /></td><td class=""></td></tr>
		</table>
		</form>
	</div>
	<div id="t2" style="display:none;">
		<form id="saltform" onsubmit="return false;">
		<div class="tips_1"><b>论坛安全码</b><br />
		* 论坛安全码可以用于加强论坛密码安全，以及提供给其他程序的数据接口时的安全认证。<br />
		* 一般情况无需修改。如要修改，请输入32位的不容易猜测的字符串。<br />
				</div>
		<div class="div_clear" style="height:10px;"></div>
		<table class="table_1">
			<tr><td class="td_0">论坛安全码:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="text" value="{$row['salt']}" maxLength="32" size="32" name="settings[salt]" class="text_css" /></td><td class="td_2">请输入32位的不容易猜测的字符串</td></tr>
			<tr><td class="td_3"><input class="button_css" type="button" value="  提  交  " onclick="ajax_savesalt()" /></td><td class=""></td></tr>
		</table>
		</form>				
	</div>
	<div id="t3" style="display:none;">
		<form id="apiform" onsubmit="return false;">
		<div class="tips_1"><b>API通信密钥</b><br />
		* 可以设置针对某个API/合作网站的通信密钥
		</div>
		<div class="div_clear" style="height:10px;"></div>
		<table class="table_1">
			<tr><td class="td_0">API名称:密钥设置:</td><td class=""></td></tr>
			<tr><td class="td_1" style='width:400px;'><textarea style='width:380px;height:300px;' name='settings[apikey]'>
			{$row['apikey']}</textarea></td><td class="td_2">请用“:”隔开API名称和密钥设置。<br />每个API占一行。<br />API_NAME:API_KEY<br />例如：6kapi:f6fdffe48c908deb0f4c3bd36c032e72</td></tr>
			<tr><td class="td_3"><input class="button_css" type="button" value="  提  交  " onclick="ajax_saveapikey()" /></td><td class=""></td></tr>
		</table>
		</form>	
	</div>
	<div class="div_clear" style="height:30px;"></div>
	<script>
	var smallNowTab;
	var pt = new Tabs();
	pt.classpre="smalltab_";
	pt.container = "smalltab_container";
	pt.createTab("t1","验证码设置","",true,"n");
	pt.createTab("t2","论坛安全码","",false,"n");
	pt.createTab("t3","API通信密钥","",false,"n");
	pt.init = function(){
		smallNowTab = pt.nowTab;
	};
	pt.onclick = function(){
		smallNowTab = pt.nowTab;
	};		
	pt.initTab();
	pt.clickNowTab();
	
	var signupsecuritycode="{$row['signupsecuritycode']}";
	var loginsecuritycode="{$row['loginsecuritycode']}";
	var postsecuritycode="{$row['postsecuritycode']}";
	setRadioCheck("settings[signupsecuritycode]",signupsecuritycode);
	setRadioCheck("settings[loginsecuritycode]",loginsecuritycode);
	setRadioCheck("settings[postsecuritycode]",postsecuritycode);
	
	function ajax_saveverifyinfo(){
		popwin.loading();
		ajaxPost("verifyform","main_ajax.php?action=saveverifyinfo",ajax_saveverifyinfo_callback);
	}
	function ajax_saveverifyinfo_callback(data){
		var btns=[{value:" 确 定 ",onclick:"popwin.close();",focus:true}];
		popwin.loaded();
		if(data=="y"){
			popwin.showDialog(1,"修改成功","验证码设置修改成功",btns,280,130);
		}else{
			popwin.showDialog(0,"操作失败","操作失败:<br />"+data,btns,280,130);
		}
	}
	function ajax_savesalt(){
		popwin.loading();
		ajaxPost("saltform","main_ajax.php?action=savesalt",ajax_savesalt_callback);
	}
	function ajax_savesalt_callback(data){
		var btns=[{value:" 确 定 ",onclick:"popwin.close();",focus:true}];
		popwin.loaded();
		if(data=="y"){
			popwin.showDialog(1,"修改成功","论坛安全码修改成功",btns,280,130);
		}else{
			popwin.showDialog(0,"操作失败","操作失败:<br />"+data,btns,280,130);
		}
	}
	function ajax_saveapikey(){
		popwin.loading();
		ajaxPost("apiform","main_ajax.php?action=saveapikey",ajax_saveapikey_callback);
	}
	function ajax_saveapikey_callback(data){
		var btns=[{value:" 确 定 ",onclick:"popwin.close();",focus:true}];
		popwin.loaded();
		if(data=="y"){
			popwin.showDialog(1,"修改成功","论坛API通信密钥修改成功",btns,280,130);
		}else{
			popwin.showDialog(0,"操作失败","操作失败:<br />"+data,btns,280,130);
		}
	}
	
	</script>
EOT;

	break;
	/************************************** securitycode END ************************************************/


	
	/************************************** offical BEGIN ************************************************/
	case "offical":	//官方论坛资讯
	$ntime=time();
echo <<<EOT
	<div id="smalltab_container"></div>
	<div class="smalltab_line"></div>
	<div class="div_clear" style="height:10px;"></div>
	<div id="t1">
		<div class="tips_1"><b>官方论坛资讯</b><br />
		* 以下资讯来自官方论坛，了解更多资讯可以访问： <a href="http://www.6kbbs.com" target="_blank">http://www.6kbbs.com</a>
		</div>
		<div class="div_clear" style="height:10px;"></div>
		<div id="offical_content"></div>
		<script type="text/javascript" src="http://www.6kbbs.net/ad/bbs_offical.php"></script>
	</div>
	
	<div class="div_clear" style="height:30px;"></div>
	<script>
	var smallNowTab;
	var pt = new Tabs();
	pt.classpre="smalltab_";
	pt.container = "smalltab_container";
	pt.createTab("t1","官方论坛资讯","",true,"n");
	pt.init = function(){
		smallNowTab = pt.nowTab;
	};
	pt.onclick = function(){
		smallNowTab = pt.nowTab;
	};		
	pt.initTab();
	pt.clickNowTab();
	</script>
EOT;

	break;
	/************************************** offical END ************************************************/


}	
?>